//
//  ZDHomeWebViewController.swift
//  1026SwiftSinaWeiBo
//
//  Created by Apple on 15/11/11.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit
import SVProgressHUD

class ZDHomeWebViewController: UIViewController, UIWebViewDelegate {
    
    var url: NSURL?
    
    override func loadView() {
        
        view = webView
        
        webView.delegate = self
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
        if let URL = url {
            
            webView.loadRequest(NSURLRequest(URL: URL))
        }
    }

    
    //MARK: - 代理方法
    //已经开始加载
    func webViewDidStartLoad(webView: UIWebView) {
        
        SVProgressHUD.showWithStatus("正在加载...", maskType: SVProgressHUDMaskType.Black)
    }
    
    //加载完毕
    func webViewDidFinishLoad(webView: UIWebView) {
        
        SVProgressHUD.dismiss()
    }
    
    
    
    private lazy var webView: UIWebView = UIWebView()

}
